<template>
    <div class="pull-container">
        <PullRefresh v-model="isLoading" @refresh="onRefresh">
           <div class="pull-content">
                <p>刷新次数: {{ count }}</p>
           </div>
        </PullRefresh>
    </div>
</template>

<script>
import { PullRefresh } from 'vant';
export default {
    components: {
        PullRefresh
    },
    data() {
        return {
            isLoading: false,
            count: 0
        }
    },
    methods: {
        // 下拉刷新
        onRefresh() {
            // 此处可以进行异步接口操作
            setTimeout(() => {
                this.count++
                this.isLoading = false
            }, 2000)
        },
    },
}
</script>

<style lang="less" scoped>
    .pull-container {
        width: 100%;
        .pull-content {
            height: 100vh;
            p {
                text-align: center;
                padding: 20px 0px;
            }
        }
    }
</style>

